package main

import (
	"fmt"
	"os"
	"time"
)

func main() {
	abort := make(chan struct{})
	go func() {
		os.Stdin.Read(make([]byte, 1))
		abort <- struct{}{}
	}()
	fmt.Println("Commencing countdonw. Press return to abort.")
	//tick := time.Tick(1 * time.Second)
	//for countDown := 10; countDown > 0; countDown-- {
	//	fmt.Println(countDown)
	//	<- tick
	//}
	select {
	case <-time.After(10 * time.Second):
	case <-abort:
		fmt.Println("launch aborted!")
		return
	}
	launch()
}

func launch() {
	fmt.Println("launch")
}
